package com.bio.dao.attachment.impl;

import java.util.List;
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;
import com.bio.dao.attachment.AttachmentDAO;
import com.bio.dao.impl.HibernateDaoImpl;
import com.bio.entity.attachemnt.Attachment;

public class AttachmentDAOImpl extends HibernateDaoImpl<Attachment> implements AttachmentDAO{

	@SuppressWarnings("unchecked")
	@Override
	public List<Attachment> getAttachmentsByObjectId(Long id) {
		DetachedCriteria criteria = DetachedCriteria.forClass(Attachment.class);
		criteria.add(Restrictions.eq("objectId", id));
		return getHibernateTemplate().findByCriteria(criteria);
	}

	
	
}
